//
//  SDDeviceModel.h
//  SinoDetection
//
//  Created by DCN1266 on 2022/4/15.
//

#import <UIKit/UIKit.h>
#import "SDConstant.h"

NS_ASSUME_NONNULL_BEGIN

/// 读Mac地址服务标识符关键字
extern NSString * const SDDMMacUUID;
/// 通知特征标识符关键字
extern NSString * const SDDMNotifyUUID;
/// 写特征标识符关键字
extern NSString * const SDDMWriteUUID;
/// 读特征标识符关键字
extern NSString * const SDDMReadUUID;
/// 写命令类型关键字
extern NSString * const SDCWriteCommandType;
/// 写命令描述关键字
extern NSString * const SDCWriteCommandDescription;

@interface SDDeviceModel : NSObject<NSCopying>

///
@property (nonatomic, strong) NSString *rowId;
/// 设备图片
@property (nonatomic, strong) NSString *image;
/// 产品码
@property (nonatomic, strong) NSString *productCode;
/// 名称
@property (nonatomic, strong) NSString *deviceName;
/// 机器码
@property (nonatomic, strong) NSString *machineCode;
///
@property (nonatomic, strong) NSString *dataProtocolCode;
/// 是否需要过程数据
//@property (nonatomic, assign) BOOL isNeedProgressData;
/// 设备标识名称，如“BDE_WEIXIN_TTM”
@property (nonatomic, strong) NSString *bluetoothPrefixName;
///
@property (nonatomic, strong) NSString *bluetoothType;
/// 设备类型
@property (nonatomic, assign) SDCDeviceType deviceType;
/// Mac地址，如“00000000”
@property (nonatomic, strong) NSString *mac;
/// 格式化的Mac地址
@property (nonatomic, strong, readonly) NSString *formattedMac;
/// SN号
@property (nonatomic, strong) NSString *sn;
/// 设备标识符
@property (nonatomic, strong) NSString *uuid;
/// 服务标识符字典
@property (nonatomic, strong, readonly) NSDictionary *services;
/// 特征字典
@property (nonatomic, strong, readonly) NSDictionary *characteristics;
/// 写命令数组
@property (nonatomic, strong, readonly) NSArray *writeCommands;


/// 构造扫描的设备模型对象
/// @param type 设备类型
/// @param uuid 设备标识符
/// @param bluetoothPrefixName 设备标识名称，如“BDE_WEIXIN_TTM”
/// @param mac Mac地址
/// @param sn SN号
+ (instancetype)scannedDeviceModelWithType:(SDCDeviceType)type
                                      uuid:(NSString *)uuid
                       bluetoothPrefixName:(NSString *)bluetoothPrefixName
                                       mac:(nullable NSString *)mac
                                       sn:(nullable NSString *)sn;


@end

NS_ASSUME_NONNULL_END
